package com.linux4fun.factorymode;

/**
 * 形状工厂
 * https://kylepeng93.github.io
 *
 * @author pengkai
 * @date 2021-12-05 下午10:17
 */
public class ShapeFactory extends AbstractFactory {

    /**
     * 获取颜色的实例
     *
     * @return
     */
    @Override
    public Color getColor(String color) {
        return null;
    }

    /**
     * 获取形状的实例
     *
     * @return
     */
    @Override
    public Shape getShape(String shape) {
        if (shape.equals("CIRCLE")) {
            return new Circle();
        } else if (shape.equals("RECTANGLE")) {
            return new Rectangle();
        }
        return null;
    }
}
